﻿using System;
using System.Windows.Forms;

namespace KWBridge
{
    public partial class KJParasUserControl : UserControl
    {
        public KJParasUserControl( )
        {
            InitializeComponent( );

            InitializeCbbKJType( );
        }

        private void InitializeCbbKJType( )
        {
            this.cbbKJType.Items.AddRange( new object[ ]
                                              {
                                                  "KJ90N",
                                                  "KJ95N",
                                                  "KJ4N",
                                                  "KJ70N",
                                                  "KJ70B",
                                                  "KJ75N",
                                                  "KJ78N",
                                                  "KJ66N",
                                                  "KJ86N",
                                                  "KJ92N",
                                                  "KJ126N",
                                                  "KJ80N",
                                                  "KJ143",
                                                  "KJQHWL",
                                                  "TDAUTO"
                                              } );
        }

        private void cbbKJType_SelectedIndexChanged( object sender , EventArgs e )
        {
            switch ( cbbKJType.Text )
            {
                case "KJ66N":
                case "KJ70N":
                case "KJ70B":
                case "KJ75N":
                case "KJ76N":
                case "KJ78N":
                case "KJ86N":
                case "KJ90N":
                case "KJ95N":
                case "KJ92N":
                case "KJ126N":
                case "KJ103N":
                    tbDevFile.Text = "dev.txt";
                    tbRtData.Text = "rtdata.txt";
                    break;

                case "KJ4N":
                case "KJXY":
                    tbDevFile.Text = "InOutDefine";
                    tbRtData.Text = "实时数据;开关量";
                    break;

                case "KJ80N":
                case "KJ2000F":
                    tbDevFile.Text = "initdata.txt";
                    tbRtData.Text = "realdata.txt";
                    break;

                case "KJ143":
                    tbDevFile.Text = "AQMC;AQKC";
                    tbRtData.Text = "AQSS;AQLJ";
                    break;

                case "KJQHWL":
                case "TDAUTO":
                    tbDevFile.Text = "dev.txt";
                    tbRtData.Text = "rtdata.txt";
                    break;
            }

            if ( cbbKJType.Text.Trim( ) == "" )
            {
                tbDevFile.Text = string.Empty;
                tbRtData.Text = string.Empty;
            }
        }
    }
}